package com.example.yjhadmin.controller;

import com.example.yjhadmin.service.TeamFeign;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yc.yjh.entity.Result;
import com.yc.yjh.entity.Teams;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/yjh/admin")
public class TeamController {
    @Resource
    TeamFeign teamFeign;
    @RequestMapping("selectTeam")
    public List selectTeam(){
        return teamFeign.selectTeam();
    }
    @RequestMapping("selectAllTeams")
    public PageInfo<Teams> selectAllTeams(@RequestParam int current){
        return teamFeign.selectAllTeams(current);
    }
    @RequestMapping("selectTeamsCount")
    public Long selectTeamsCount(){
        return teamFeign.selectTeamsCount();
    }
    @RequestMapping("selectTeamByName")
    public Result selectTeamByName(@RequestParam("name") String name){
        return teamFeign.selectTeamByName(name);
    }
}
